/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package org.sbbs.demo.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import java.util.Currency;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.annotations.PartitionKey;
import org.hibernate.annotations.SoftDelete;
import org.hibernate.type.SqlTypes;
import org.hibernate.type.YesNoConverter;
import org.sbbs.base.jpa.entity.BaseEntity;

/**
 *
 * @author jenkins
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "misc_base_entity")
@Comment("样例表")
@SoftDelete(columnName = "removed", converter = YesNoConverter.class)
public class MiscBaseBean extends BaseEntity {

    @Column(nullable = true)
// mapped as VARCHAR
    private Class<?> clazz;

// mapped as VARCHAR
    @Column(nullable = true)
    private Currency currencyField;
// mapped as VARCHAR
    @Column(nullable = true)
    private Locale localeField;
// mapped as VARCHAR
    @Column(nullable = true, length = 36)
    private UUID uuid;
    @Column(nullable = true)
    private String address;
//    private InetAddress address;
    @Column(nullable = true)
    @JdbcTypeCode(SqlTypes.JSON)
    private Map<String, String> stringMapJson;

//    @JdbcTypeCode(SqlTypes.SQLXML)
//    private Map<String, StringNode> stringMapXml;
//    @Convert(converter = BitSetConverter.class)
//    private BitSet bitSet;
//    @Version
//    private long version;

    @PartitionKey
    private String tenantKey;

}
